package com.swingson.other;

import java.lang.reflect.Method;

/**
 * @author sad
 */
public class MethodExecutor {
    private final Object object;
    private final Method method;

    public MethodExecutor(Object object, Method method) {
        this.object = object;
        this.method = method;
    }

    public Object invoke(Object... args) throws Exception {
        if (method != null) {
            return method.invoke(object, args);
        }
        return null;
    }
}
